/*
 * test02.c
 *
 * Created: 17.03.13 13:41:10
 *  Author: ЖЕНЯ
 */ 
#ifndef F_CPU
#define F_CPU			16000000UL
#endif

#include <avr/io.h>
#include <avr/interrupt.h>
#include "periph/proc_events.h"
#include "periph/uart_interface.h"
#include "periph/drive.h"
#include "periph/hctl_2032_encoder.h"
#include "periph/perifclk.h"
#include "periph/adc_router.h"
#include "periph/config.h"
#include "periph/adc_router.h"

/*#include <util/delay.h>*/


int main(void)
{
	/* initialize all of the interface modules */
	InitBaseIO();
	if(!loadCfg()) SetDefConfig();
	FlashLeds();
	UartInt_init();
	InitHCTL();
	InitPerifClk();
	InitDrive(ALL_DRIVE);
	InitADC();
	
	
	/*I2CInt_init();
	CamInt_init();*/
	
	/* initialize the remaining modules that will process
	data...interrupts need to be on for these */
	/*ENABLE_INTS();
	CamConfig_init(); 
	UIMgr_init();
	FrameMgr_init();*/
    
	/* provide a short delay for the camera to stabilize before
	we let the executive start up */
	//Utility_delay(1000);
	
	/* the rest of the application will be under the
	control of the Executive.  */
	sei();
	Exec_run();
	
	/* this should never be reached */
	return (0);
}